extends ./../layout.jade
append script
    script.
        $(function(){
            $('.popup').popup();
            $('.ui.dropdown').dropdown();
            $('.ui.pointing.secondary.menu a.item').eq(1).addClass('active');
        });
    script(src="/js/project.dist.test.js")

block content
    br
    .ui.breadcrumb
        a.section(href="/home") 首页
        i.right.chevron.icon.divider
        a.section #{project.name}
        i.right.chevron.icon.divider
        a.section.active 测距仪配置
        
    h2.ui.header
        span.ui.header #{project.name}配置
        .sub.header 测距仪配置
    .ui.divider
    include navigator.jade

    
    div
        form.ui.form(action='/project/'+project.id+'/distconfig',method="post")
            input(type="hidden" , value=project.id , name="prjId")
            table.ui.table.celled
                thead
                    th 仪器编号
                    th com端口
                    th(style="width:200px;") 操作
                tbody
                    each device,index in devices
                        tr
                            td #{device.deviceId}
                                // a.origin.popup(href='/project/'+project.id+'/distconfig/'+device.id+'/learn',data-content="点击进入测距仪测试") 
                            td
                                .ui.selection.dropdown
                                    input(type="hidden",name="com",value=distCom,id="com-input-"+device.id)
                                    i.dropdown.icon
                                    .text #{distCom}
                                    .menu
                                        - for (var x = 1; x < 11; x++)
                                            .item(data-value='COM'+x) COM#{x} 
                            td
                                a.button.ui.orange.test(data-device-uid=device.id) 测试
                                a.button.ui.grey(href='/project/'+project.id+'/distconfig/'+device.id+'/delete') 删除
                    tr
                        td
                            .field
                                input(type="number",name="deviceId",required="required")
                        td
                            .ui.selection.dropdown.disabled
                                input(type="hidden",name="com",value=distCom)
                                i.dropdown.icon
                                .text #{distCom}
                                .menu
                                    - for (var x = 1; x < 11; x++)
                                        .item(data-value='COM'+x) COM#{x} 
                        td
                            button.ui.blue.button(type="submit") 增加